package com.hxkj.dao.impl;

import com.hxkj.dao.NoticeDao;
import com.hxkj.mapper.NoticeMapper;
import com.hxkj.domain.po.Notice;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-06-05 19:32:55
*
*/
@Service("noticeDao")
public class NoticeDaoImpl implements NoticeDao {

    @Resource
    private NoticeMapper noticeMapper;

    @Override
    public Notice get(Long noticeId) {
        return noticeMapper.selectByPrimaryKey(noticeId);
    }

    @Override
    public List<Notice> get(Notice notice) {
        return noticeMapper.select(notice);
    }

    @Override
    public int delete(Long noticeId) {
        return noticeMapper.deleteByPrimaryKey(noticeId);
    }

    @Override
    public int delete(Notice notice) {
        return noticeMapper.delete(notice);
    }

    @Override
    public int save(Notice notice) {
        return noticeMapper.insert(notice);
    }

    @Override
    public int update(Notice notice) {
        return noticeMapper.update(notice);
    }

    @Override
    public List<Notice> getNoticeList(Notice notice)  {
        return noticeMapper.select(notice);
    }

    @Override
    public Notice selectNoticeTitle(Notice notice)   {
        return noticeMapper.selectNoticeTitle(notice);
    }
}
